import axios from '_l/api.request'

/**
 * 添加
 * @param become
 * @returns {ClientHttp2Stream | * | AxiosPromise<any> | ClientRequest | void}
 */
export const saveBecome = (become) => {
  return axios.request({
    url: '/oa/become/save',
    method: 'post',
    data: become
  })
}

/**
 * 提交
 * @param become
 * @returns {*}
 */
export const submitBecome = (become) => {
  return axios.request({
    url: '/oa/become/submit',
    method: 'post',
    data: become
  })
}

/**
 * 重新提交
 * @param become
 * @returns {*}
 */
export const reSubmitBecome = (become) => {
  return axios.request({
    url: '/oa/become/reSubmit',
    method: 'post',
    data: become
  })
}

/**
 * 创建并且提交
 * @param become
 * @returns {*}
 */
export const createAndSubmitBecome = (become) => {
  return axios.request({
    url: '/oa/become/createAndSubmit',
    method: 'post',
    data: become
  })
}

/**
 * 删除
 * @param id
 * @returns {ClientHttp2Stream | * | AxiosPromise<any> | ClientRequest | void}
 */
export const deleteBecomeById = (id) => {
  return axios.request({
    url: '/oa/become/delete',
    method: 'post',
    params: {
      id: id
    }
  })
}

/**
 * 获取详细
 * @param id
 * @returns {AxiosPromise}
 */
export const getBecomeById = (id) => {
  return axios.request({
    url: '/oa/become/getBecomeById',
    params: {
      id: id
    }
  })
}
